package com.zhongyu.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhongyu.pojo.StoreOper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface StoreOperMapper extends BaseMapper<StoreOper> {
    @Select("SELECT t1.*,t2.username,t3.sname,t4.name FROM smbms_store_oper t1 JOIN smbms_user t2 ON t1.operate_id=t2.id JOIN smbms_store t3 ON t3.id=t1.store_id JOIN smbms_goods t4 ON t4.id=t1.good_id ${ew.customSqlSegment}")
    @ResultMap("operRm")
    List<StoreOper> findAll(Page page, @Param("ew") Wrapper wrapper);
}
